/*-------------------------------------------------------------------------

   File :          mbtx2.h
   Project :       VeriFone SoftPay Base
   Description :   Wireless Modem Functions


***************** Modification History ***********************************

$Log: /SoftPay/SPK2SIM/Source/Include/mbtx2.h $

**************************************************************************

   Copyright (C) 1999 by VeriFone, Inc.

   All rights reserved.  No part of this software may be reproduced,
   transmitted, transcribed, stored in a retrieval system, or translated
   into any language or computer language, in any form or by any means,
   electronic, mechanical, magnetic, optical, chemical, manual or otherwise,
   without the prior written permission of VeriFone, Inc.

---------------------------------------------------------------------------*/

#ifndef VSMBTX2_H
#define VSMBTX2_H

#include <transact.h>
#include <comm.h>
#include <packet.h>


void vdInitializeMobitexComm (COMM_OBJECT *obCommunication);
void vdPacketErrorCheck(char *szPacket);
int  inInitMobitexCommunication(COMM_OBJECT *obCommunication);
int  inDeInitMobitexCommunication(COMM_OBJECT *obCommunication);
long lnHexStringToLong(char *szHex);
int inSendMobitexAck(int inRack);
int inCheckPacket(char *pchBuffer );
int inSendMobitexNack(void);
int inSendMobitexSACK(void);
int inReSendMobitexPacket(PACKET_OBJECT *pobPacket, TRANSACTION_OBJECT *pobTran);
int inHexCodedAsciiPacketToAsynch(unsigned char *szReceiveBuffer, char *szTempBuffer, int *inSize);
int inAsynchToHexCodedAsciiPacket(unsigned char *szMxBuffer, unsigned char *szSendBuffer, int inSendSize, int inSendBuffSize);
int inGetLength(unsigned char  *szBuffer );
int inCalculateLength(unsigned char  *szLength);
int inAddLRC(char  *szPacket );
int inFlushMobitexCommunication (void);
int inSendMobitexBPacket(void);
int inSendMobitexFIPacket(void);
int inSendMobitexFPPacket(void);
int inSendMobitexFAPacket(void);
int inHexStringToInt( char *szHex );
int inEndMobitexCommunication (COMM_OBJECT *obCommunication);
int inGetLength(unsigned char  *szBuffer );
int inCheckPacket(char *pchBuffer );
int inAddLRC(char  *szPacket );
int inHexStringToInt( char *szHex );
long lnHexStringToLong( char *szHex );
int inSendMobitexAck(int inRack);
int inSendMobitexFOPacket(void);
int inMobitexCommunicate (TRANSACTION_OBJECT *pobTran, PACKET_OBJECT *obPacket);
int inMobitexRecvChar(int inTimeOut, char chType, PACKET_OBJECT *pobPacket);
int inMobitexRecvAnyChar(int inTimeOut, char *chChar, PACKET_OBJECT *pobPacket);
int inMobitexSendChar(char chSendChar, TRANSACTION_OBJECT *pobTran);
int inCompleteResendMobitex(PACKET_OBJECT *pobPacket, TRANSACTION_OBJECT *pobTran, VS_BOOL fCancel);
void vdAddParity( unsigned char *chChar, int inParityType );
void vdRemoveParity( unsigned char *chChar );


#endif


